package com.alibaba.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @author : hanyang
 * @date : 2023-11-02 23:59
 **/

@Getter
public enum LinkStatusEnum {

    APPROVED(0, "审核通过"),
    REJECTED(1, "审核未通过"),
    UNREVIEWED(2, "未审核"),
    UN_KNOWN(3, "未知");

    private final Integer code;
    private final String description;

    LinkStatusEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    // 根据code获取对应的枚举
    public static LinkStatusEnum parseCode(Integer code) {
        for (LinkStatusEnum status : LinkStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return UN_KNOWN;
    }



}
